package collection;

import clone.Person;
import clone.Student;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: feiwang_6
 * @create: 2020/7/3 23:21
 * @description:
 */
public class ConsistentHashTreeMap {
    public static void main(String[] args) throws CloneNotSupportedException {
        
        String str = "";
        str.toCharArray();
        List<String> list = new ArrayList<String>();
        list.add("11");
        Student stu = new Student();
        stu.setClasses("大学");

        Person per1 = new Person();
        per1.setList(list);
        per1.setStudent(stu);
        per1.setName("seky");

        Person per2 = (Person) per1.clone();
        per2.getStudent().setClasses("小学");//会改变原始类的student信息
        per2.getList().set(0, "33");//会改变原始类的list信息

        System.out.println(per1 == per2);
        System.out.println(per1.getStudent().getClasses());
        System.out.println(per2.getStudent().getClasses());
        System.out.println(per1.getList().get(0));
        System.out.println(per2.getList().get(0));
    }
    
    public static void test(int n){
        int a = 1;
        int b = 1;
        for(int i = 1; (a <= n && b <= n); i++) {
            System.out.print(a + "\t" + b + "\t");
            a = a + b;
            b = a + b;
        }
    }
}
